home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 01 / 6 / DISK0162.ZIP / SCREEN.INC < prev    next >
Text File  |  1984-06-25  |  2KB  |  89 lines

  1. ' SCREEN.INC:    a set of sample screen formatting routines.
  2. '
  3. ' version:        6-25-84
  4. ' compiler:        Structured BASIC v1.12
  5. ' uses:            CLS.INC
  6. ' module type:    include
  7. '
  8. ' To use this package, put the statement
  9. '
  10. '        include SCREEN.INC
  11. '
  12. ' in your program.  Before you can use the procedures here, you must
  13. ' have the statement
  14. '
  15. '        do INITIALIZE.SCREEN
  16. '
  17. ' somewhere.  The variables you can then reset yourself are:
  18. '
  19. '        SCREEN.WIDTH    The width of the screen in characters (40/80)
  20. '        BORDER$            The character you want displayed in borders
  21.  
  22.  
  23. procedure INITIALIZE.SCREEN 'Initialize all the screen variables
  24.     SCREEN.WIDTH = 80
  25.     BORDER$ = string$(SCREEN.WIDTH,&HC4)
  26.     MSG.MASK$ = space$(20)
  27.     do SETUP.CLS
  28. endproc
  29.  
  30. procedure CLEAR.SCREEN        'Clear the screen, set keys off    
  31.     key off : width SCREEN.WIDTH : cls
  32. endproc
  33.  
  34. procedure SET.TITLES        'Redisplay all the titles 
  35.     do CLEAR.SCREEN
  36.     locate 1,1                                 : print L.TITLE$;
  37.     locate 1,SCREEN.WIDTH-len(R.TITLE$)+1     : print R.TITLE$;
  38.     locate 3,1                                 : print BORDER$
  39. endproc
  40.  
  41. procedure SET.FUNCTION.MSG    'Update the function message
  42.     locate 2,1
  43.     print left$(FUNC.MSG$+MSG.MASK$,20);
  44. endproc
  45.  
  46. procedure SET.ACTION.MSG    'Update the action message
  47.     locate 2,61
  48.     print right$(MSG.MASK$+ACT.MSG$,20);
  49. endproc
  50.  
  51. procedure CLEAR.AREA        'Clear lines 4 thru end of screen
  52.     locate 4,1
  53.     do CLEOS
  54. endproc
  55.  
  56. procedure SET.LINE.24        'Put a message on line 24
  57.     locate 24,1
  58.     print LINE.24.MSG$;
  59. endproc
  60.  
  61. procedure CLEAR.LINE.24        'Clear the 24th line of the screen
  62.     locate 24,1
  63.     do CLEOL
  64. endproc
  65.  
  66. procedure DRAW.BOX            'Draw a box
  67.     locate BOX.ROW,BOX.COL
  68.     print chr$(&HDA);string$(BOX.LEN-2,&HC4);chr$(&HBF)
  69.     locate ,BOX.COL
  70.     for BOX.I=1 to BOX.HT-2
  71.         print chr$(&HB3);space$(BOX.LEN-2);chr$(&HB3)
  72.         locate ,BOX.COL
  73.     next BOX.I
  74.     print chr$(&HC0);string$(BOX.LEN-2,&HC4);chr$(&HD9)
  75. endproc
  76.  
  77. procedure DRAW.FRAME        'Draw a frame (double lines)
  78.     locate FRAME.ROW,FRAME.COL
  79.     print chr$(&HC9);string$(FRAME.LEN-2,&HCD);chr$(&HBB)
  80.     locate ,FRAME.COL
  81.     for FRAME.I = 1 to FRAME.HT-2
  82.         print chr$(&HBA);space$(FRAME.LEN-2);chr$(&HBA)
  83.         locate ,FRAME.COL
  84.     next FRAME.I
  85.     print chr$(&HC8);string$(FRAME.LEN-2,&HCD);chr$(&HBC)
  86. endproc
  87.  
  88. include CLS.INC
  89.